package task.manager;

import java.util.ArrayList;

/**
 * The category class for the task manager.
 * 
 * @author Harrison Saylor, Aaron Mead, Marc Huet, Greg Ruskin
 * @version 1.0
 */
public class Category {
	
	private TaskList tasks;
	private String name;
	
	/**
	 * Category constructor that creates a category and taskList for it.
	 * 
	 * @param name Name of the Category.
	 */
	public Category(String name){
		this.name = name;
		tasks = new TaskList();
	} // End of constructor.
	
	/**
	 * Adds a new task.
	 * 
	 * @param newTask The new task to add.
	 */
	public void addTask(Task newTask){
		tasks.addTask(newTask);
	} // End of addTask method.
	
	/**
	 * Creates a new task.
	 * 
	 * @param title Name of the task.
	 */
	public void createTask(String title, int month, int day, int year, Integer hour, Integer minute){
		addTask(new Task(title, month, day, year, hour, minute));
	} // End of createTask method.
	
	/**
	 * Gets the Category name.
	 * 
	 * @return The Category name.
	 */
	public String getName(){
		return name;
	} // End of getName() method.
	
	/**
	 * Gets the TaskList of the Category.
	 * 
	 * @return The TaskList for the Category.
	 */
	public TaskList getTaskList(){
		return tasks;
	} // End of getTaskList() method.

	/**
	 * Gets the array of the tasks of the Category.
	 * 
	 * @return Task array.
	 */
	public Task[] getTaskArray() {
		return tasks.getAllTasks();
	} // End of getTaskArray() method.

} // End of Category class.
